home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Windows / System32 / HTMLRE90.DLL / HTML / 11052 < prev    next >
Encoding:
Text File  |  2002-07-05  |  7.6 KB  |  280 lines

  1. <HTML>
  2. <HEAD>
  3.   <LINK REL="stylesheet" TYPE="text/css" HREF="%4css/default.css">
  4.  
  5. <script language=Javascript>
  6. //LOCALIZATION STRINGS
  7. var L_DESCRIPTION_SEPARATOR = ": ";
  8. </script>
  9.  
  10. <script>
  11. var descArr = new Array();
  12. %7
  13.  
  14. function init()
  15. {
  16.     // Remove the formatting options
  17.     document.sf.targets.options[0] = null; 
  18.     document.sf.choices.options[0] = null; 
  19. }
  20.  
  21. function showDesc(list)
  22. {
  23.     var listLength = list.length;
  24.     var outputstring = "";
  25.     var bFound = false;
  26.  
  27.     for(var i = 0; i < listLength; i++) 
  28.     {
  29.         if (list[i].selected) 
  30.         {
  31.             if(bFound)
  32.             {
  33.                 // more than one item selected so don't show any description
  34.                 outputstring = "";
  35.                 break;
  36.             }
  37.  
  38.             outputstring = list[i].text + L_DESCRIPTION_SEPARATOR + descArr[list[i].value];
  39.             bFound = true;
  40.         }
  41.     }
  42.  
  43.     document.forms['sf'].desc.value = outputstring;
  44. }
  45.  
  46. function moveTarget(direction)
  47. {
  48.     var list = document.forms['sf'].targets.options;
  49.     var listLength = list.length;
  50.  
  51.     // no need to do anything if there are fewer than 2 items in the list
  52.     if(listLength < 2)
  53.         return;
  54.  
  55.     var bFound = false;
  56.     var index = -1;
  57.     for(var i = 0; i < listLength; i++) 
  58.     {
  59.         if (list[i].selected) 
  60.         {
  61.             // don't do anything if more than one item selected
  62.             if(bFound)
  63.                 return;
  64.  
  65.             index = i;
  66.             bFound = true;
  67.         }
  68.     }
  69.  
  70.     // only move if not moving the first item up or moving the last one down
  71.     if(bFound && !(index == 0 && direction == -1) && !(index == listLength-1 && direction == 1))
  72.     {
  73.         // swap the selected item with either the one below it (for moving down) or the
  74.         // one above it (for moving up)
  75.  
  76.         var selectedItem = document.sf.targets.options[index];
  77.         var swapWithItem = document.sf.targets.options[index + direction];
  78.  
  79.         selected_name = selectedItem.text;
  80.         selected_id   = selectedItem.value;
  81.  
  82.         selectedItem.text = swapWithItem.text;
  83.         selectedItem.value = swapWithItem.value;
  84.  
  85.         swapWithItem.text = selected_name;
  86.         swapWithItem.value = selected_id;
  87.  
  88.         selectedItem.selected = false;
  89.         swapWithItem.selected = true;
  90.     }
  91. }
  92.  
  93. function blurIt()
  94. {
  95.     document.sf.targets.focus();
  96. }
  97.  
  98. function addTarget()
  99. {
  100.     // Run through this list twice, once to add, once to delete
  101.     total = document.sf.choices.options.length; 
  102.     for (count = 0; count < total; ++count)
  103.     {
  104.         current_target = document.sf.choices.options[count];
  105.             
  106.         if (current_target.selected)
  107.         {
  108.  
  109.             // remove the object from the current targets
  110.             target_name = current_target.text;
  111.             target_id   = current_target.value; 
  112.  
  113.             // Create a new option
  114.             option = new Option(target_name, target_id, false, false); 
  115.  
  116.             // add it to the possible targets
  117.             document.sf.targets.options[document.sf.targets.options.length] = option;
  118.         }
  119.     }
  120.  
  121.     for (count = document.sf.choices.options.length -1;  count >= 0; --count)
  122.     {
  123.         if (document.sf.choices.options[count].selected)
  124.             document.sf.choices.options[count] = null; 
  125.     }
  126. }
  127.  
  128. function deleteTarget()
  129. {
  130.     
  131.     // Run through the options and remove the current selections
  132.     total = document.sf.targets.length;
  133.     for (count = 0; count < total; ++count)
  134.     {
  135.         current_target = document.sf.targets.options[count];    
  136.         if (current_target.selected)
  137.         {
  138.             // remove the object from the current targets
  139.             target_name = current_target.text;
  140.             target_id   = current_target.value; 
  141.         
  142.             // Create a new option
  143.             option = new Option(target_name, target_id, false, false); 
  144.  
  145.             // add it to the possible targets
  146.             document.sf.choices.options[document.sf.choices.options.length] = option;
  147.         }
  148.     }
  149.     for (count = total -1; count >= 0;  --count)
  150.     {
  151.         if (document.sf.targets.options[count].selected)
  152.         {
  153.             document.sf.targets.options[count] = null; 
  154.         }
  155.  
  156.     }
  157. }
  158.  
  159. function doSubmit()
  160. {
  161.     final_value = ""; 
  162.     first = true; 
  163.  
  164.     for (var count = 0; count < document.sf.targets.options.length; ++count)
  165.     {
  166.         if (!first)
  167.         {
  168.             final_value += "*"; 
  169.         }
  170.         else first = false; 
  171.  
  172.         current_target = document.sf.targets.options[count];    
  173.         final_value += current_target.value;
  174.  
  175.         // De-select all entries on the select box
  176.         current_target.selected = false;
  177.     }
  178.  
  179.     // Build the string
  180.     document.sf.checkedItems.value = final_value;
  181.  
  182.     document.forms['sf'].submit()
  183. }
  184.  
  185. </script>
  186.  
  187. </HEAD>
  188.  
  189. <BODY LEFTMARGIN="5" RIGHTMARGIN="5" onload="init();">
  190.  
  191. <DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;z-index:99;"></DIV>
  192.  
  193. <SCRIPT SRC="%5js/helps.js"></SCRIPT>
  194. <SCRIPT SRC="%6js/tips.js"></SCRIPT>
  195.  
  196. <SPAN CLASS="listSelected">Set the default selection formula for the report.</SPAN>
  197. <BR>
  198. This report contains selection formula which viewers can use to filter the report by selecting different values.  
  199. The defaults set here will be the initial filter values.
  200. <BR>
  201. <FORM NAME="sf" METHOD="POST" ACTION="%1">
  202. %2
  203. <BR>
  204. %3
  205.  
  206. <p>
  207.  
  208. <SPAN CLASS="listSelected">Set the processing extensions that this report will use.</SPAN>
  209. <input type="hidden" name="checkedItems" value="">
  210. <table>
  211. <tr><td>
  212.  
  213.   <table align=left CELLPADDING="0" CELLSPACING="0" border=0>
  214.   <tr> 
  215.     <td class="list" colspan=2 valign='bottom' align=left>Available Processing Extensions:</td>
  216.     <td class="list" width='250px' valign='bottom' align=left>Use these Processing Extensions (in the order listed):</td> 
  217.     <td class="list"> </td>
  218.   </tr>
  219.   <tr>
  220.     <td class="list" align=left>
  221.         <SELECT class="menuFormElement" onchange='showDesc(this.options)' onclick='showDesc(this.options)' multiple NAME="choices" SIZE=5 style='width:250px' width='250px'>
  222.             <OPTION> This is a formatting string </OPTION>
  223.             %8
  224.         </SELECT>
  225.     </td>
  226.     <td>
  227.         <table> 
  228.             <tr><td align=middle>
  229.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  230.                 <tr><td class="clsButton" align=middle nowrap> 
  231.                     <div class="clsButton"><a href="javascript:addTarget()">    >    </a></div>
  232.                 </td></tr>
  233.                 </table>
  234.             </td></tr>
  235.             <tr><td align=middle>
  236.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  237.                 <tr><td class="clsButton" align=middle nowrap>     
  238.                     <div class="clsButton"><a href="javascript:deleteTarget()">    <    </a></div> 
  239.                 </td></tr>
  240.                 </table>
  241.             </td></tr>
  242.         </table>
  243.     </td>
  244.     <td class="list" align=left>
  245.         <SELECT class="menuFormElement" onchange='showDesc(this.options)' onclick='showDesc(this.options)' multiple NAME="targets" SIZE=5 style='width:250px' width="250px">
  246.             <OPTION> This is a formatting string </OPTION>
  247.             %9
  248.         </SELECT>
  249.     </td>
  250.     <td valign=top>
  251.     <a href='javascript:moveTarget(-1);'><img src='%4images/uparrow.gif' alt='Up' height=20 border=0></a><br>
  252.     <a href='javascript:moveTarget(1);'><img src='%4images/downarrow.gif' alt='Down' height=20 border=0></a>
  253.     </td>
  254.   </tr>
  255.   </table>
  256.  
  257. </td></tr>
  258. <tr><td class='list'>
  259.   Description:<br>
  260.   <input type='text' size=65 name='desc' value='' disabled onfocus='blurIt();'>
  261.  
  262. </td></tr>
  263. </table>
  264.  
  265.   <table align=right border=0 cellpadding=0>
  266.   <tr valign=center>
  267.   <td class="clsButton" align=middle nowrap>
  268.   <div class="clsButton"><a href="javascript:doSubmit();" onMouseOver="St(7);window.status='';return true;" onMouseOut="Ht()">Update</a></div>
  269.   </td>
  270.   <td class="clsButton" align=middle nowrap>
  271.   <div class="clsButton"><a href="javascript: document.forms.sf.reset()" onMouseOver="St(8);window.status='';return true;" onMouseOut="Ht()">Reset</a></div>
  272.   </td>
  273.   </tr>
  274.   </table>
  275. </FORM>
  276.  
  277.  
  278. </BODY>
  279. </HTML>
  280.